﻿using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;

namespace Team33Assignment1
{
    class Enemy : GameObject
    {
        Player goal;
        int id;

        public Enemy(Model model, Vector3 pos, Player goal, int id)
            : base(model, pos)
        {
            this.goal = goal;
            this.id = id;
            scaleValue = 0.05f;
        }

        public int getId()
        {
            return id;
        }

        public void Update(bool collided)
        {
            Vector3 direction = goal.position - this.position;
            double time = 0.01;
            // Calculate the distance.
            float distanceFromGoal = Vector3.Distance(goal.position, this.position);

            if (this.position != goal.position)
            {
                this.position += (direction * (float)time);
            }
        }

    }
}
